package com.pro.controller;

import com.pro.pojo.JsCourseJournal;
import com.pro.pojo.JsonData;
import com.pro.service.JsCourseJournalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsCourseJournalController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/12/13 21:10
 * @Author: ZPT
 */
@RestController
@RequestMapping("/journal")
public class JsCourseJournalController {
    @Autowired
    private JsCourseJournalService service;

    @RequestMapping("/getJournal")
    public JsonData getJournal(Integer productCode,String  productName,String updateDate){
        List<JsCourseJournal> journal = service.getJournal(productCode,productName,updateDate);
        return journal!=null?JsonData.buildSuccess(journal):JsonData.buildError("服务端错误");
    }

    @RequestMapping("/removeJournalById")
    public JsonData removeJournalById(Integer id){
        Integer i = service.removeJournalById(id);
        return i>0?JsonData.buildSuccess(i):JsonData.buildError("服务端错误");
    }
}
